import { defineStore } from 'pinia';
import type { UploadChangeParam } from 'ant-design-vue';

export interface FileState {
  logoFile: UploadChangeParam['file'] | null,
  imageFileList: Array<UploadChangeParam['file']>,
}

export default defineStore('file', {
  state: () => {
    const state: FileState = {
      logoFile: null,
      imageFileList: [],
    };
    return state;
  },
  actions: {
    setLogoFile (file: UploadChangeParam['file']) {
      this.logoFile = file;
    },
    setImageFileList (fileList: Array<UploadChangeParam['file']>) {
      this.imageFileList = fileList;
    },
  },
});